<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<c:if test="${not empty sessionScope.refeicaoAlimentos}">
	<c:forEach var="refeicaoAlimento" items="${sessionScope.refeicaoAlimentos}" varStatus="count">
		<tr bgcolor="#EFEFEF">
			<td><c:out value="${fn:length(refeicaoAlimento.alimento.nome) > 18 ? fn:substring(refeicaoAlimento.alimento.nome,0,16) : refeicaoAlimento.alimento.nome}" /></td>
			<td><fmt:formatNumber value="${refeicaoAlimento.calorias}" type="number" minFractionDigits="2" maxFractionDigits="2" /></td>
			<td>${refeicaoAlimento.porcao}</td>
			<td>
				<input name="excluirAlimento" type="button" value="Excluir" onClick="excluirAlimentoLista(${count.index});">
			</td>
		</tr>
	</c:forEach>
</c:if>